package org.qsoft.test.service.impl;

import java.util.List;

import org.qsoft.test.TestException;
import org.qsoft.test.dao.UsersDAO;
import org.qsoft.test.model.Users;
import org.qsoft.test.service.IUsersService;

public class UsersServiceImpl implements IUsersService {

	private UsersDAO usersDAO = null;

	public UsersDAO getUsersDAO()  throws TestException{
		return usersDAO;
	}

	public void setUsersDAO(UsersDAO dao) throws TestException {
		this.usersDAO = dao;
	}

	public List findAll() throws TestException{
		return this.usersDAO.findAll();
	}
	 
	public void createUser(Users user) throws TestException
	{
		this.usersDAO.save(user);
	}

	public void deleteUserById(int id)  throws TestException{
		this.usersDAO.deleteById(id);
	}

	public Users findById(Integer id)  throws TestException{
		return this.usersDAO.findById(id);
	}

	public List findByPage(int i, int limit) throws TestException {
		
		return this.usersDAO.findPage(i, limit);
	}

	public void modifyUser(Users userdto)  throws TestException{
		this.usersDAO.update(userdto);
	}

}
